The present invention relates to a PWM (Pulse Width Modulation) circuit for outputting a PWM signal by executing logical operation of a reference pulse sequence and comparison pulse sequence.
A conventional PWM circuit includes a reference pulse sequence based on a reference clock, and a comparison pulse sequence generating section for generating a comparison pulse sequence. To vary a PWM pulse width while in operation, the PWM circuit varies the value of the comparison pulse sequence generating section.
Japanese Patent Laid-Open Publication No. 61-99412, for example, teaches a PWM circuit of the type varying the amplitude of a carrier signal while maintaining the amplitude of a PWM input signal constant. This type of PWM circuit includes a memory which stores data representative of PWM input signals crossing the carrier signal at each carrier period when the carrier signal has a preselected reference amplitude. A counter has a clock which is variable in portion to the ratio of the carrier signal to the reference amplitude. The counter inverts its logical value upon counting pulses for a preselected period of time at the beginning of each carrier period. In addition, means is provided for reading the data stored in the memory at the beginning of each carrier period, and for setting the data or a difference between the data and the amplitude of the carrier signal in the counter.
Japanese Patent Laid-Open Publication No. 6-214523 discloses an automatic contrast adjusting device for an LCD (Liquid Crystal Display). The adjusting device references a character table listing a relation between the output and the LCD drive voltage. A CPU (Central Processing Unit) sets a count for the high level period of PWM pulses. A contrast switch is connected to the CPU via an encoder used to vary the duty ratio of the PWM pulses set by the CPU.
The problem with the above conventional PWM circuit is that when the user desires to adjust the PWM value while the circuit is in operation, software processing using an MPU (Micro Processing Unit) is needed for intermediation. For example, when the user desires to adjust the contrast of an LCD, it is necessary for an MPU to obtain a factor for varying the PWM value, perform calculations, and then set a new value in the comparison pulse sequence generating section. Specifically, the conventional method which requires software is not practicable without resorting to the intermediary of a main MPU built into a computer to which the LCD is connected, or to an exclusive MPU for LCD contrast adjustment.
However, the exclusive MPU scheme complicates the circuit arrangement and increases the cost. When the main MPU of the computer is used to vary the PWM value, the LCD contrast adjustment effected by the user consumes the processing time of the computer and thereby reduces the performance of the computer. Moreover, because the main MPU of a computer generally operates at high frequency, the processing using main MPU consumes more power than the processing normally would when no t relying on the MPU. This is particularly true with a notebook-type personal computer.
Technologies relating to the present invention are also disclosed in, e.g., Japanese Patent Laid-Open Publication Nos. 62-60306, 4-233601, 7-277030, and 7-264052.
It is therefore an object of the present invention to provide a PWM circuit using a reference pulse sequence and a comparison pulse sequence which is capable of automatically varying, while in operation, the value of the comparison pulse sequence by automatic hardware conversion without the intermediary of MPU processing.
It is another subject of the present invention to provide a PWM circuit using a reference pulse sequence and comparison pulse sequence which is capable of varying, while in operation, the value of the comparison pulse sequence by either one of automatic software or hardware conversion.
A PWM circuit of the present invention includes a reference pulse sequence generating section for outputting a reference pulse sequence, an up-down counter, a trigger signal generating section for generating in response to an input signal, a trigger signal for the up-down counter having a period which is a natural number multiple of the period of PWM, and a comparator for comparing the output of the up-down counter and the reference pulse sequence.